<ul class="nav nav-tabs" ng-init="checkarray(pagedata.item,'tabs')">
	<li ng-repeat="tab in pagedata.item.tabs"><a href="javascript:;" ng-click="pagedata.edit_tab(tab)">{{tab.title}}</a><em class="jy-close" href="javascript:;" ng-click="pagedata.item.tabs.splice($index,1)">×</em></li>
	<li><a href="javascript:;" ng-click="i=pagedata.item.tabs.push({'title':'导航名称'});pagedata.edit_tab(pagedata.item.tabs[i-1])"><i class="fa fa-plus"></i>添加导航</a></li>
	<li><a href="javascript:;" ng-click="pagedata.modal('setting')">页面基本信息设置</a></li>
</ul>
<ul class="nav nav-tabs" ng-show="pagedata.item.tab_open">
	<li ng-repeat="edit_tab in pagedata.item.edit_tabs" ng-class="{'active':pagedata.item.current_index==$index}"><a href="javascript:;" ng-click="pagedata.item.current_index=$index;pagedata.edit_edit_tab(edit_tab);">{{edit_tab.title}}</a><em class="jy-close" href="javascript:;" ng-click="pagedata.item.current_index=$index-1;pagedata.item.edit_tabs.splice($index,1)">×</em></li>
	<li><a href="javascript:;" ng-click="i=pagedata.item.edit_tabs.push({'title':'tab名称','list':[]});pagedata.item.current_index=i-1;pagedata.edit_edit_tab(pagedata.item.edit_tabs[i-1])"><i class="fa fa-plus"></i>添加tab</a></li>
</ul>
<div class="panel panel-default form-horizontal" ng-repeat="edit_tab in pagedata.item.edit_tabs" ng-show="pagedata.item.current_index==$index">
	<div class="panel-heading"></div>
	<div class="panel-body">
		<div ng-repeat="seh in edit_tab.list" ng-include="sys_html('app_develop/plugin/show_edit/edit/'+pagedata.field_types[pagedata.fields[seh.name].leixing].type)"></div>
		<div class="pull-left col-xs-12 col-sm-3 col-md-2 col-lg-2" ng-click="i=edit_tab.list.push({'title':'表单名称','help':'表单提示信息'});pagedata.edit_form(edit_tab.list[i-1])">
			<button class="btn btn-primary"><i class="fa fa-plus"></i>添加一个表单项</button>
		</div>
	</div>
</div>
<div class="modal-sub" ><button  class="btn btn-primary">{{pagedata.item.submit_title}}</button></div>
<!-- 页面基本参数设置-->
<div id="floating-content-setting"  class="modal fade"  tabindex="-1" style="z-index:2000;display:none">
    <div class="jinyun-modal-dialog modal-dialog" style='width: 920px;'>
        <div class="modal-content">
            <div class="modal-header"><button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button><h3>设置页面基本参数</h3></div>
			<div class="modal-body">
			<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 left-label">页面标题</label>
					<div class="col-xs-12 col-sm-8 col-lg-9">
						<input type="text" class="form-control " ng-model="pagedata.item.title"  />
						<div class="help-block">设置页面标题</div>
					</div>
			</div>
			<div class="form-group" >
				<label class="col-xs-12 col-sm-3 col-md-2 left-label">表单页类型</label>
				<div class="col-xs-12 col-sm-8 col-lg-9">
					<div class="radio radio-inline" ng-repeat="(value,dtitle) in pagedata.edit_types">
						<label>
							<input type="radio" value="{{value}}" ng-model="pagedata.item.edit_type"/>{{dtitle}}
						</label>
					</div>
					<div class="help-block">设置表单页类型</div>
				</div>
			</div>
			<div class="form-group" >
					<label class="col-xs-12 col-sm-3 col-md-2 left-label">是否开启多tab编辑</label>
					<div class="col-xs-12 col-sm-8 col-lg-9">
						<label class="left-label">
							<div ng-show="pagedata.item.tab_open" class="switch  switchOn" ng-click="pagedata.item.tab_open=false"></div>
							<div ng-show="!pagedata.item.tab_open" class="switch" ng-click="pagedata.item.tab_open=true"></div>
						</label>
						<div class="help-block">当编辑项比较多时，可通过对编辑项进行分类，点击tab切换的形式，优化编辑体验。</div>
					</div>
			</div>
			<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 left-label">提交成功跳转</label>
					<div class="col-xs-12 col-sm-8 col-lg-9">
						<div class="input-group">
							<input type="text" class="form-control" placeholder="选择页面"  ng-model="pagedata.item.url"/>
							<span class="input-group-btn">
								<button class="btn btn-primary" type="button" ng-click="pagedata.choose_url(pagedata.item,'url')"><i class="fa fa-external-link"></i>选择页面</button>
							</span>
						</div>
						<div class="help-block"></div>
					</div>
			</div>
			</div>
            <div class="modal-footer"><a href="javascript:;" aria-hidden="true" data-dismiss="modal" class=" btn btn-primary">确定</a></div>
        </div>
    </div>
</div>
<div id="floating-content-edit_form"  class="modal fade"  tabindex="-1" style="z-index:2000;display:none">
    <div class="jinyun-modal-dialog modal-dialog" style='width: 920px;'>
        <div class="modal-content">
            <div class="modal-header"><button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button><h3>设置表单项参数</h3></div>
			<div class="modal-body">
			<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 left-label">表单名称</label>
					<div class="col-xs-12 col-sm-8 col-lg-9">
						<input type="text" class="form-control " ng-model="pagedata.current_search.title"  />
						<div class="help-block">位于输入框左侧</div>
					</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 left-label">选择字段</label>
				<div class="col-xs-12 col-sm-8 col-lg-9">
					<select class="form-control" ng-model="pagedata.current_search.name">
						<option value="" selected>请选择编辑字段</option>
						<option ng-repeat="field in pagedata.fields" ng-selected="pagedata.current_search.name==field.name" value="{{field.name}}" >{{field.title}}</option>
					</select>
					<div class="help-block"></div>
				</div>
			</div>
			<div class="form-group" >
					<label class="col-xs-12 col-sm-3 col-md-2 left-label">是否关联显示</label>
					<div class="col-xs-12 col-sm-8 col-lg-9">
						<label class="left-label">
							<div ng-show="pagedata.current_search.guanlian" class="switch  switchOn" ng-click="pagedata.current_search.guanlian=false"></div>
							<div ng-show="!pagedata.current_search.guanlian" class="switch" ng-click="pagedata.current_search.guanlian=true"></div>
						</label>
						<div class="help-block"></div>
					</div>
			</div>
			<div class="form-group" ng-show="pagedata.current_search.guanlian">
				<label class="col-xs-12 col-sm-3 col-md-2 left-label">选择关联字段</label>
				<div class="col-xs-12 col-sm-8 col-lg-9">
					<select class="form-control" ng-model="pagedata.current_search.guanlian_field">
						<option value="" selected>请选择字段</option>
						<option ng-repeat="field in pagedata.fields" ng-selected="pagedata.current_search.guanlian_field==field.name" value="{{field.name}}" >{{field.title}}</option>
					</select>
					<div class="help-block"></div>
				</div>
			</div>
			<div class="form-group" ng-show="pagedata.current_search.guanlian">
					<label class="col-xs-12 col-sm-3 col-md-2 left-label">关联字段值</label>
					<div class="col-xs-12 col-sm-8 col-lg-9">
						<input type="text" class="form-control " ng-model="pagedata.current_search.guanlian_value"  />
						<div class="help-block">当关联字段值为上述值时，显示本表单编辑项</div>
					</div>
			</div>
			<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 left-label">表单提示信息</label>
					<div class="col-xs-12 col-sm-8 col-lg-9">
						<input type="text" class="form-control " ng-model="pagedata.current_search.help"  />
						<div class="help-block">位于输入框下方</div>
					</div>
			</div>
			<!--
			<div class="form-group" ng-show="pagedata.current_search.type=='select'">
				<label class="col-xs-12 col-sm-3 col-md-2 left-label">列表提示信息</label>
					<div class="col-xs-12 col-sm-8 col-lg-9">
						<input type="text" class="form-control " ng-model="pagedata.current_search.select_title"  />
						<div class="help-block"></div>
					</div>
			</div>
			<div class="form-group" ng-show="pagedata.current_search.type=='select'">
				<label class="col-xs-12 col-sm-3 col-md-2 left-label">列表数据来源</label>
				<div class="col-xs-12 col-sm-8 col-lg-9">
					<select class="form-control" ng-model="pagedata.current_search.options">
						<option value="0" selected>请选择数据来源</option>
						<option ng-repeat="table in pagedata.tables" ng-selected="pagedata.current_search.options==table.name" value="{{table.name}}" >{{table.title}}</option>
					</select>
					<div class="help-block"></div>
				</div>
			</div>
			
			<div class="form-group" ng-show="pagedata.current_search.type=='select'">
				<label class="col-xs-12 col-sm-3 col-md-2 left-label">列表数据值字段</label>
				<div class="col-xs-12 col-sm-8 col-lg-9">
					<select class="form-control" ng-model="pagedata.current_search.option_value">
						<option value="" selected>请选择字段</option>
						<option ng-repeat="field in pagedata.tables[pagedata.current_search.options].fields" ng-selected="pagedata.current_search.option_value==field.name" value="{{field.name}}" >{{field.title}}</option>
					</select>
					<div class="help-block">例如，设置商品分类作为列表数据来源，以商品分类的ID字段作为值字段，title字段作为显示字段。则当用户选择时，看到的是分类名。选中后，后台进行数据库筛选时是根据ID字段进行筛选。因为一般商品表里面保存的是分类ID而非分类名称</div>
				</div>
			</div>
			<div class="form-group" ng-show="pagedata.current_search.type=='select'">
				<label class="col-xs-12 col-sm-3 col-md-2 left-label">列表数显示字段</label>
				<div class="col-xs-12 col-sm-8 col-lg-9">
					<select class="form-control" ng-model="pagedata.current_search.option_title">
						<option value="" selected>请选择字段</option>
						<option ng-repeat="field in pagedata.tables[pagedata.current_search.options].fields" ng-selected="pagedata.current_search.option_title==field.name" value="{{field.name}}" >{{field.title}}</option>
					</select>
					<div class="help-block">例如，设置商品分类作为列表数据来源，以商品分类的ID字段作为值字段，title字段作为显示字段。则当用户选择时，看到的是分类名。选中后，后台进行数据库筛选时是根据ID字段进行筛选。因为一般商品表里面保存的是分类ID而非分类名称</div>
				</div>
			</div>
			
			<div class="form-group" ng-show="pagedata.current_search.type=='choose'">
				<label class="col-xs-12 col-sm-3 col-md-2 left-label">设置数据选择页</label>
				<div class="col-xs-12 col-sm-8 col-lg-9">
						<div class="input-group">
							<input type="text" class="form-control" placeholder="选择字段"  ng-model="pagedata.current_search.url"/>
							<span class="input-group-btn">
								<button class="btn btn-primary" type="button" ng-click="modal_func(pagedata.current_search,'url','','choose_page')"><i class="fa fa-external-link"></i>选择页面</button>
							</span>
						</div>
					<div class="help-block"></div>
				</div>
			</div>
			
			<div class="form-group" ng-show="pagedata.current_search.type=='radio' || pagedata.current_search.type=='checkbox'">
				<label class="col-xs-12 col-sm-3 col-md-2 left-label">选项数据来源</label>
				<div class="col-xs-12 col-sm-8 col-lg-9">
					<select class="form-control" ng-model="pagedata.current_search.options">
						<option value="0" selected>请选择数据来源</option>
						<option ng-repeat="table in pagedata.radios" ng-selected="pagedata.current_search.options==table.name" value="{{table.name}}" >{{table.title}}</option>
					</select>
					<div class="help-block"></div>
				</div>
			</div>
			 -->
			 </div>
            <div class="modal-footer"><a href="javascript:;" aria-hidden="true" data-dismiss="modal" class=" btn btn-primary">确定</a></div>
        </div>
    </div>
</div>
<div id="floating-content-edit_edit_tab"  class="modal fade"  tabindex="-1" style="z-index:2000;display:none">
    <div class="jinyun-modal-dialog modal-dialog" style='width: 920px;'>
        <div class="modal-content">
            <div class="modal-header"><button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button><h3>设置tab名称</h3></div>
			<div class="modal-body form-horizontal">
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 left-label">tab名称</label>
					<div class="col-xs-12 col-sm-8 col-lg-9">
						<input type="text" class="form-control " ng-model="pagedata.current_tab.title"  />
						<div class="help-block"></div>
					</div>
				</div>
			</div>
            <div class="modal-footer"><a href="javascript:;" aria-hidden="true" data-dismiss="modal"  class="btn btn-primary close">确定</a></div>
        </div>
    </div>
</div>
<script>
scope.pagedata.edit_form=function(seh){
	scope.pagedata.current_search=seh;
	window.bootstrap('#floating-content-edit_form').modal();
}
scope.pagedata.edit_edit_tab=function(tab){
		scope.pagedata.current_tab=tab;
		window.bootstrap('#floating-content-edit_edit_tab').modal();
	}
</script>